package com.example.testdemo.mapper;

import com.example.testdemo.model.messageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageInfoMapper {
    //插入
    @Insert("insert into message_info(`from`,`to`,`message`) " +
            "values (#{msg.from},#{msg.to},#{msg.message})")
    Integer insertMSG(@Param("msg") messageInfo messageInfo);
    //查询
    @Select("select * from message_info where delete_flag = 0")
    List<messageInfo> selectMSG();
}
